package dao;

import entity.Java;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Statement;

public class JavaDao {
    public static int add(Java java , Connection connection) throws SQLException {
        String  sql = "insert into Java(job_id,job_name,job_city,company,salary,experience,ed) values (?,?,?,?,?,?,?)";
        PreparedStatement statement = connection.prepareStatement(sql);
        statement.setString(1,java.getJobId());
        statement.setString(2,java.getJonName());
        statement.setString(3,java.getJobCity());
        statement.setString(4,java.getCompany());
        statement.setString(5,java.getSalary());
        statement.setString(6,java.getExperience());
        statement.setString(7,java.getEd());

        int count = statement.executeUpdate();
        statement.close();
        return count;
    }
}
